<?php
if ($this->Session->flash()):
?>
	<div class="alert alert-warning">
		<?php  echo $this->Session->flash();?>
	</div>
<?php
endif;
?>

<div class="row">
	<div class="col-lg-12">
		<h2 class="page-header"><?php echo $title_for_layout?></h2>
	</div>
</div>
<?php echo $this->Form->create('Advertise', array('class' => 'ajax_page', 'type' => 'file'));?>
<table class="table table-striped table-bordered table-hover" id="dataTables-example">
	<tr>
		<th width="20%">Chọn vị trí</th>
		<td>
			<?php
			echo $this->Form->input('ban_type', array(
					'options' => $banner_type,
					'empty' => '--Chọn vị trí--',
					'label' => false,
					'class' => 'form-control',
			));
			?>
		</td>
	</tr>
	<tr>
		<th>Tên quảng cáo</th>
		<td>
			<?php
			echo $this->Form->input('ban_name', array(
					'type' => 'text',
					'label' => false,
					'class' => 'form-control w400',
					'required' => true,
					'id'=>'cat_name',
					'value'=>'',
			));
			?>
		</td>
	</tr>
	<tr>
		<th>Ảnh quảng cáo</th>
		<td>
			<?php
			echo $this->Form->file('file][',
				array('type' => 'file',
				'id'=>'file',
				'class'=>'file',
				'subImage'=>'',
			));
			?>
		</td>
	</tr>
	<tr>
		<th>Link</th>
		<td>
			<?php
			echo $this->Form->input('ban_link', array(
					'type' => 'text',
					'label' => false,
					'div' => false,
					'class' => 'form-control w400',
					'id'=>'ban_link',
					'value'=>''
			)).' ';

			echo $this->Html->link(
				'Tạo liên kết',
				array(
					'controller' => 'createLink',
					'action' => 'create',
					'ban_link',
				),
				array(
					'onclick' => 'return false;',
					'id' => 'create_link',
					'class'=>'btn btn-primary'
				)
			);
			?>
		</td>
	</tr>

	<tr>
		<th>Target</th>
		<td>
			<?php
			echo $this->Form->input('ban_target', array(
					'options' => $target,
					'label' => false,
					'div' => false,
					'class' => 'form-control',
			));
			?>
		</td>
	</tr>

	<tr>
		<th>Thứ tự</th>
		<td>
			<?php
			echo $this->Form->input('ban_order', array(
					'type' => 'text',
					'label' => false,
					'class' => 'form-control',
					'id'=>'cat_order',
					'value'=>''
			));
			?>
		</td>
	</tr>

	<tr>
		<th>&nbsp;</th>
		<td>
			<div class="form-group">
			<?php
			echo $this->Form->hidden('ban_active', array('value' => 1));

			echo $this->Form->button('Submit', array(
					'type' => 'submit',
					'class' => 'btn btn-primary',
					'label' => false,
					'div' => false,
				)
			).'  ';

			echo $this->Form->button('Reset', array(
					'type' => 'reset',
					'class' => 'btn btn-primary',
					'label' => false,
					'div' => false,
				)
			);
			?>
			</div>
		</td>
	</tr>
</table>
<?php echo $this->Form->end()?>